import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

export default new Vuex.Store({
  state: {
      num1:22,
      num2:6
  },
  getters: {
    result(state){
      return parseInt(state.num1) + parseInt(state.num2);
    }
  },
  mutations: {
    setNum(state,{value,name}){
      state[name] = value;
    }
  },
  actions: {
  },
  modules: {
  }
})
